// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{eb691a4d-25b6-423b-965c-01a7f0d81bb5}")]
	[UmlMetaAttribute("association", typeof(TTServerPackage.Hallenbelegung))]
	#endregion

	#region Documentation
	//1 Belegung einer Halle durch einen Verein
	/// Belegung einer Halle durch einen Verein
	#endregion

	#endregion
	public class Hallenbelegung: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 4);
			public const int Bemerkung_MemberIndex = Eco_FirstMember + 0;
			public const int Hallenbelegungszeit_MemberIndex = Eco_FirstMember + 1;
			public const int Spiellokal_MemberIndex = Eco_FirstMember + 2;
			public const int Verein_MemberIndex = Eco_FirstMember + 3;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}

		public TTServer.Halle Spiellokal
		{
			get
			{
				return (TTServer.Halle) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spiellokal_MemberIndex));
			}
		}

		public TTServer.Verein Verein
		{
			get
			{
				return (TTServer.Verein) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Verein_MemberIndex));
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(Hallenbelegung.Eco_LoopbackIndices.Bemerkung_MemberIndex), Id="{e8bd2f7d-15ca-4e9f-b3a0-13ac1e924ee2}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Bemerkung zur Hallenbelegung
		/// Bemerkung zur Hallenbelegung
		#endregion

		#endregion
		public string Bemerkung
		{
			get
			{
				#region MM_ECO_Generated
				return (string) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Bemerkung_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Bemerkung_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(Hallenbelegung.Eco_LoopbackIndices.Hallenbelegungszeit_MemberIndex), Id="{16194b42-8cc6-4e22-94bc-8461eb44ec84}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.HallenbelegungHallenbelegungszeit), Index=1)]
		[UmlMetaAttribute("multiplicity", "0..*")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public IEcoList<Hallenbelegungszeit> Hallenbelegungszeit
		{
			get
			{
				#region MM_ECO_Generated
				return new ObjectListAdapter<Hallenbelegungszeit>((IList) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Hallenbelegungszeit_MemberIndex)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public Hallenbelegung(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public Hallenbelegung(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
